-module(socket_timer).
-compile(export_all).
start(Time)->
	Pid = spawn(fun() -> 
		waitfor(Time)
		end),
	Pid!message.

waitfor(Time)->
	receive
		cancel ->
			void
		after Time ->
			init()
	end.

init()->
	apply(xengine_prediction,connect,[]),
	timer:sleep(60000),
	apply(xengine_prediction,connect,[]),
	timer:sleep(60000),
	apply(xengine_prediction,connect,[]),
	timer:sleep(60000),
	apply(xengine_prediction,connect,[]),
	timer:sleep(60000),
	apply(xengine_prediction,connect,[]),
	timer:sleep(60000),
	apply(xengine_algo,connect,[]),
	apply(xengine_prediction,connect,[]),
	timer:sleep(60000),
	init().

